<template>
  <div>
    御剑乘风来,除魔天地间!=====Father====={{ this.$store.state.age }}==={{ age }}=={{ name }}
    <button
      @click="handel"
    >改变state中的值</button>
    <hr />
    <button @click="dinsshi(80)">actions</button>
    ==={{ $store.state.age }}
    <hr />
    <button>getters</button>
    ===={{ total }}
    <hr>
    <button>moudlues</button>===={{ $store.state.user.str }}===={{ str }}==={{ num }}
    <hr>
    <button @click="change2">moudlues</button>==={{ num }}

  </div>
</template>
<script>

import { mapGetters, mapActions, mapState, mapMutations } from 'vuex';
export default {
  name: '',
  data () {
    return {

    }
  },
  created () {
    // console.log(this.$store.state.name);
    console.log(this.$store);
  },
  computed: {
    ...mapState('user',['str','num']),
    ...mapState(['age', 'name']),
    ...mapGetters(['total']),

  },
  methods: {
    ...mapActions(['dinsshi']),
    ...mapMutations(['handel']),
    //       handel(){
    // this.$store.commit('handel')
    //       }
change2(){
  this.$store.commit('user/change2')
}
  },
}
</script>
<style lang='less'  scoped>
</style>
